1. Field of the Invention
The present invention relates generally to electronic communication. More specifically, the present invention relates to a solution that provides a non-blocking architecture to a single pipe environment.
2. Description of the Related Art
Universal Serial Bus (USB) protocol is a standard communications protocol for sending signals between devices and host controllers. USB has become the standard mechanism to communicate between computer devices, and is commonly used to link peripherals, such as keyboards, mice, external disk drives, etc. with personal computers. It is also quite commonly used to link various self-sufficient devices, such as cellular phones, portable media devices, etc. with personal computers.
The USB Attached SCSI (UAS) protocol can be used to move data to and from USB storage device by using the USB protocol with a standard Small Computing System Interface (SCSI) command set. SCSI is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, and device properties.
UAS uses a single pipe through which to transmit both data commands and management commands from a host personal computer to a target device. The data commands, typically reads and writes, operate directly on data stored in the target device. The management commands can involve various aspects of storage management, such as aborting outstanding requests from a queue.
FIG. 1 is a diagram illustrating a standard UAS architecture. As can be seen, a single pipe 100 is used between the UAS driver host 102 and the storage controller and target device 104. The target device may use a storage controller and disk command queue 106 to receive the commands from the UAS driver host 102. The storage controller and disk command queue 106 can act to store the commands in a queue and pass management commands to the storage management module 108 when management commands are encountered, while executing disk commands on the storage medium. Native Command Queuing (NCQ) can allow up to 32 commands to be queued within the storage controller and disk command queue.
When the disk command queue 106 is full, new data commands have nowhere to go. Therefore, they have to be rejected to allow subsequent commands (which may be management commands) to get to the target. Generally, this problem is known as a head of line blocking problem—if the data command at the head of the incoming stream were not rejected it would block subsequent management commands, preventing effective device management. UAS also imposes a requirement that the target device cannot stall commands, implying that the commands need to be processed, be that queued or rejected at the rate at which the host generates them.
Simply rejecting data commands as they arrive when the queue is full creates several issues. The target can be swamped with rejection processing at a time when it is busy with other tasks, and rejecting commands degrades performance as the host stack recovers for what could just be a temporary queue full state. These problems are compounded by the fact that UAS has no limits on the rate at which commands can be issued, nor a limit on the number of outstanding commands that can be issued.
What is needed is a solution that does not suffer from these issues.